/**
 * org.assess.oa.system.service.TbDepartmentService
 */
package org.assess.oa.system.service;

import org.assess.core.service.ServiceResult;
import org.assess.oa.system.bean.TbDepartment;

/**
 * @description 部门管理的Service层接口
 * @author XiaLongxiang
 * @createtime 2012-5-15 上午9:25:33
 */
public interface TbDepartmentService {
    /**
     * 根据部门编码查询单个部门信息
     * @param department
     * @return
     */
    public TbDepartment queryTbDepartmentByCode(TbDepartment department);
    
    /**
     * 根据条件查询部门列表
     * @return
     */
    public String queryTbDepartmentAsList(TbDepartment department);
    
    /**
     * 根据条件查询部门列表，并返回支持界面树形效果的JSON字符串
     * @param department
     * @return
     */
    public String queryTbDepartmentAsTreeStr(int depth, TbDepartment department);
    
    /**
     * 根据用户编码，查询该用户的所有职能范围信息，并返回相应的JSON字符串<br>
     * 这里以list开头命名，是因为其中使用到了存储过程，用于规避spring事物
     * @param user_code
     * @return
     */
    public String listTbDepartmentAsScopeAll(String user_code);
    
    /**
     * 加载部门下拉树所需要的JSON数据
     * @param department
     * @return
     */
    public String queryTbDepartmentAsJsonArray(TbDepartment department);

    /**
     * 检查部门信息，主要是检查部门编码是否重复
     * @param department
     * @return
     */
    public String checkTbDepartment(TbDepartment department);
    
    /**
     * 保存用户信息
     * @param department
     * @param edit
     * @return
     */
    public ServiceResult saveTbDepartment(TbDepartment department, boolean edit) throws Exception;
    
    /**
     * 修改部门信息的valid_flag标识
     * @param department
     * @return
     */
    public String updateValid(TbDepartment department) throws Exception;
}
